using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Web.UI.WebControls;

namespace CodeStory.WebControls
{
	public class PropertyGridRowCollection : ICollection,IEnumerable
	{
		// Fields
		private ArrayList _rows;

		// Methods
		public PropertyGridRowCollection(ArrayList rows) {
			this._rows = rows;
		}

		public void CopyTo(PropertyGridRow[] array, int index) {
			this.CopyTo(array, index);
		}

		public IEnumerator GetEnumerator() {
			return this._rows.GetEnumerator();
		}

		void ICollection.CopyTo(Array array, int index) {
			IEnumerator enumerator = this.GetEnumerator();
			while (enumerator.MoveNext()) {
				array.SetValue(enumerator.Current, index++);
			}
		}

		// Properties
		public int Count {
			get { return this._rows.Count; }
		}

		public bool IsReadOnly {
			get { return false; }
		}

		public bool IsSynchronized {
			get { return false; }
		}

		public PropertyGridRow this[int index] {
			get { return (PropertyGridRow)this._rows[index]; }
		}

		public object SyncRoot {
			get { return this; }
		}
	}
}
